package com.example.multactivity

import android.content.Intent
import android.os.Bundle
import android.widget.Button
import android.widget.EditText
import androidx.activity.ComponentActivity


class ThirdActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        setContentView(R.layout.activity_third)

        val confirm = findViewById<Button>(R.id.confirm)

        val editText = findViewById<EditText>(R.id.editText)

       confirm.setOnClickListener {
           val intent = Intent()
           intent.putExtra(SECOND_MSG,editText.text.toString())
           setResult(1,intent)
           finish()
       }
    }
}